Implement streak tracking with persistence and frontend context#213
Implement streak tracking with persistence and frontend context#213bigjoefilms wants to merge 4 commits intoMindBlockLabs:mainfrom
Conversation
|
@bigjoefilms Please resolve conflict. And also, checkout CONTRIBUTING.md for build test to run so as to have a green cicd check |
|
@bigjoefilms all those tests have to pass locally before your cicd pass |
|
@bigjoefilms I have inspected your failed tests. It seems you have a frontend type unsafe issue and your issue has nothing to do with frontend. To ba absolutely safe, please, close this pr (and your branch if you cant control the changes in it), resync your main to the actual mindblocks main, create a fresh branch and redo the issue. I assure you, this might be easier. I will be glad to assist where you are stuck. |
|
@bigjoefilms I'm afraid this PR can't be merged without resolving the fixes and reverting the changes made to the frontend files. Thank you. |

Closes #161
Implement streak tracking with persistence and frontend context
Body
add daily streak entity + service with timezone-safe updates and duplicate-day guard
expose /streaks and /streaks/update endpoints with optional timezone input
introduce StreakProvider/useStreak on frontend and wire streak page to live data
Test Plan
BE: call POST /streaks/update twice same day → no double increment
BE: call POST /streaks/update on consecutive days (or simulate via date headers) → streak increments; skip a day → resets to 1
FE: load /streak with valid token → weekly calendar matches backend streakDates; streak count shows current
FE: trigger updateStreak() after completing daily quest → streak count updates without page reload